<?php 
session_start();
require_once('classes/blogContent.php');
$needLogin = true;  


$blogcontent->deleteComment($db, $user); //Sletter kommentarer
$blogcontent->deletePostAdmin($db, $user); //Sletter post som admin

?>
<!DOCTYPE html>
<html lang="en" >
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"> </script>
<meta charset="utf-8">
<title>EEBS</title>
<!--<link href="style.css" rel="stylesheet" /> -->
<link href="<?php echo $user->getStyle($db) //henter stilark ?>" rel="stylesheet" />
</head> 
<body>
<div id="wrapper">
	<header> 
		<h1>Enda et bullshit system</h1> 
		<a href="./" class="left image_button" ><img src="images/home.png" alt="Hjem" /></a> 		
	</header>
	
	<div id="content-wrap">
 
	<div id="sidebar">	
		<h2 style="margin-top: 0;">Bruker</h2>
		<?php //Henter sidebarmeny, bilde og loginform
			if($user->loggedOn()) { echo "Du er logget inn som ".$user->getName(); }
			$user->showImage($db);
			echo isset($userFail);
			$user->getLoginForm();
			if($user->loggedOn()) { ?>
		<h2>Brukerpanel</h2>
		<?php 
		echo $user->menu($db);
		} ?>
		<h2>Mest leste innlegg</h2>
		<?php $blogcontent->mestLesteInnlegg($db); ?>
		<h2>Mest kommenterte innlegg</h2>
		<?php $blogcontent->mestKommenterteInnlegg($db); ?>
		<?php if($user->LoggedOn()) { ?>
		<h2>Brukere ved EEBS</h2>
		<?php $user->listBlogUsers($db); }?>
	</div>
	
	
	<div id="content">
	<?php 
			if($user->loggedOnAsAdmin()) {	
	?>
		<!--<h1>Upassende kommentarer og innlegg</h1> -->
		<?php $blogcontent->visUpassende($db);
			} else {
				echo "<p>Beklager, men du må være innlogget for å se dette!</p>";
			}
	?>
	</div>
	</div>
	<footer>
		<p>Glenn, Torstein, Arve og Marius</p>
	</footer>
</div>
</body>
</html>